package algo3.tp1.tests;

import static org.junit.Assert.assertEquals;

import org.junit.Test;

import algo3.tp1.ejercicios.Ejercicio2;
import algo3.tp1.ejercicios.Matriz;

public class Ejercicio2Tests {
	@Test
	public void testResolver1() {
		int[][] m = { { 1, 2, 3 }, { 1, 1, 1 }, { 2, 3, 1 } };

		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();

		assertEquals(5, e.resolver(t));
	}

	@Test
	public void testResolver2() {
		int[][] m = { { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 1 } };

		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();

		assertEquals(9, e.resolver(t));
	}

	@Test
	public void testResolver3() {
		int[][] m = { {1,2,3}, {4,5,6}, {7,8,9} };
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(1,e.resolver(t));
	}

	@Test
	public void testResolver4() {
		int[][] m = { {1,2,3,3,3,3,3,8,9} };
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(5,e.resolver(t));
	}
	
	@Test
	public void testResolver5() {
		int[][] m = { {1,2,3},{6,3,3},{3,6,6} };
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(3,e.resolver(t));
	}
	
	@Test
	public void testResolver6() {
		int[][] m = { {1,1,1,1,1,1,1}, {1,0,9,8,7,6,1}, {1,3,2,1,4,5,1}, {1,7,6,8,4,5,1},{1,1,1,1,1,1,1} };
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(20,e.resolver(t));
	}
	
	@Test
	public void testResolver7() {
		int[][] m = {{2,2,2}, {7,2,9}, {2,2,2}};
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(7,e.resolver(t));
	}
	
	@Test
	public void testResolver8() {
		int[][] m = {{31415926,31415926,31415926}, {7,31415926,9}, {3,31415926,7}};
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(5,e.resolver(t));
	}
	
	@Test
	public void testResolver9() {
		int[][] m = {{40,78,4,68,55},{94,41,71,14,49},{36,49,97,89,2},{18,65,63,66,89},{42,17,24,22,11},{57,2,35,52,40},{78,75,97,21,26},{13,81,89,74,97},{1,21,15,45,7},{67,96,36,45,32},{51,74,93,45,93},{69,25,74,15,8},{31,32,31,47,1},{98,22,63,69,73},{64,4,33,58,7},{21,19,18,97,63},{13,73,22,23,56},{63,84,62,49,72},{94,79,24,57,58},{11,37,18,6,84}};		
		
		Matriz t = new Matriz(m);
		Ejercicio2 e = new Ejercicio2();
		
		assertEquals(3,e.resolver(t));
	}
	
	
}